﻿<UserControl x:Class="StockholmsStad.Windows.UI.Modules.Maintenance.Views.TabItemInformationTextView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"    
    >
    <Grid MinWidth="500" MinHeight="300" Margin="10,10,10,10">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        
        <!-- Select text type -->
        <StackPanel Grid.Row="0" Margin="10, 10, 10, 0" Orientation="Horizontal">
            <RadioButton x:Name="rbFaq" Content="FAQ" Click="checkBox_Click" Margin="0, 0, 10, 0" IsChecked="True" />            
            <RadioButton x:Name="rbLawText" Content="Lagtext" Click="checkBox_Click" Margin="0, 0, 10, 0"/>
        </StackPanel>

        <!-- Header -->         
        <Grid Grid.Row="1" Margin="10, 10, 10, 0">
            <StackPanel Orientation="Horizontal">

                <ComboBox x:Name="cbTexts" MinWidth="240" HorizontalAlignment="Left" ItemsSource="{Binding Mode=OneWay}">
                    <ComboBox.ItemTemplate>
                        <DataTemplate>
                            <TextBlock Text="{Binding Path=Header, Mode=OneWay}" />
                        </DataTemplate>
                    </ComboBox.ItemTemplate>
                </ComboBox>

                <TextBox x:Name="tbHeader" Width="240" Text="{Binding Header}" />
                
            </StackPanel>
        </Grid>

        <!-- Content -->
        <Border x:Name="contentBorder" Grid.Row="2" Margin="10,10,10,0" BorderThickness="1" BorderBrush="LightGray">            
            <Grid>
                <TextBox x:Name="tbContent" Text="{Binding Path=Content, Mode=TwoWay}" AcceptsReturn="True" TextWrapping="WrapWithOverflow" 
                         Height="{Binding ActualHeight, ElementName=contentBorder}"
                         VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled"
                         BorderThickness="0" BorderBrush="Transparent" />
                <TextBlock x:Name="tblContent" Text="{Binding Path=Content, Mode=OneWay}" TextWrapping="WrapWithOverflow" />
            </Grid>
        </Border>

        <!--- Action buttons -->
        <StackPanel Grid.Row="3" x:Name="spPanel" Orientation="Horizontal" Margin="0, 10, 10, 10">
            <Button x:Name="btnAdd" Content="  Lägg till  " Margin="10, 0, 0, 0" Click="btnAdd_Click" />
            <Button x:Name="btnEdit" Content="  Editera  " Margin="10, 0, 0, 0" Click="btnEdit_Click" />
            <Button x:Name="btnSave" Content="  Spara  " Margin="10, 0, 0, 0" Click="btnSave_Click" />
            <Button x:Name="btnDelete" Content="  Ta bort  " Margin="10, 0, 0, 0" Click="btnDelete_Click" />
            <Button x:Name="btnUndo" Content="  Ångra  " Margin="10, 0, 0, 0" Click="btnUndo_Click" />
        </StackPanel>
        
    </Grid>
</UserControl>
